import React from 'react';
import ReactDOM from 'react-dom';
import Index from './index';
import ComponentList from './components/list';
import {BrowserRouter,Router,HashRouter,Route,Link,hashHistory} from 'react-router-dom';


class Root extends React.Component{
    render(){
        return(
                <div>23

                    <HashRouter history={hashHistory}>
                        <div class="aw">
                        <Route exact path="/" component={Index}/>
                        <Route path="/List" component={ComponentList} />
                        </div>
                    </HashRouter>
                    </div>

        )
    }
}

// export default class Root extends React.Component {
//     render() {
//         return (
//             <div>
//                 <h1>App</h1>
//                 <ul>
//                     <li><Link to="/">Index</Link></li>
//                     <li><Link to="/List">List</Link></li>
//                 </ul>
//                 {this.props.children}
//             </div>
//         );
//     }
// }

// ReactDOM.render(
//     (<HashRouter>
//         <Root>
//             <Route exact path="/" component={Index} />
//             <Route path="/List" component={ComponentList} />
//         </Root>
//     </HashRouter>),
//     document.getElementById('app')
// );

ReactDOM.render(
    <Root/>,
    document.getElementById('app')
);